<?php
use Modules\Good\Http\Controllers\GoodController;
use Illuminate\Support\Facades\Route;
use Modules\Good\Http\Controllers\SlideController;

Route::prefix('api')->middleware(['goods.exception']) ->group(function () {
    Route::resource('goods', GoodController::class);
    // 测试异常中间件的路由
    Route::get('test-exception', function() {
        throw new \Exception('This is a test exception to verify middleware is working');
    });
    Route::put('goods/{good}/is-on', [GoodController::class, 'isOn']);
});
Route::prefix('api')->group(function () {
    Route::resource('slides', SlideController::class);
    Route::put('slides/{slide}/seq', [SlideController::class, 'seq']);
});
